<div class="layui-form-item layui-form-text">
	<label class="layui-form-label">子题目内容</label>
	<div class="layui-input-block">
		<!-- 加载编辑器的容器 -->
	    <script id="container7" name="suanshi[title]" type="text/plain">
	        <{$topic_info.subject_text|default:""}>
	    </script>
	</div>
</div>

<div id="an_tiankong_box">
	<div class="layui-form-item">
		<label class="layui-form-label">题目答案1</label>
		<div class="layui-input-block">
			<input type="text" placeholder="算式" name="suanshi[calc][1]" lay-verify="required" autocomplete="off" class="layui-input tiankong_answer">
		</div>
	</div>
	<div class="layui-form-item">
		<a href="javascript:;" class="layui-btn layui-btn-primary add_calc"><i class="layui-icon"></i>新增算式</a>
	</div>
</div>

<div class="layui-form-item layui-form-text">
	<label class="layui-form-label">答案解析</label>
	<div class="layui-input-block">
		<textarea name="suanshi[analysis]" placeholder="请输入内容" class="layui-textarea"></textarea>
	</div>
</div>

<script>
	layui.use(['form'], function(){
		var form = layui.form();
		form.render();
		$(".add_calc").click(function(){
			var _this = $(this);
			var tiankong_total = _this.closest("#an_tiankong_box").find(".tiankong_answer").length;
			var index = tiankong_total+1;
			var html = '<div class="layui-form-item">';
			html +=	'<label class="layui-form-label">题目答案' + index +'</label>';
			html +=	'<div class="layui-input-block">';
			html +=	'<input type="text" placeholder="算式" name="suanshi[calc]['+index+']" lay-verify="required" autocomplete="off" class="layui-input tiankong_answer">';
			html += '</div></div>';
			_this.closest(".layui-form-item").before(html);
		});
	});
</script>